package cn.iocoder.yudao.module.tms.dal.mysql.orderfollowlog;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.tms.dal.dataobject.orderfollowlog.OrderFollowLogAttachmentDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 产品跟进记录附件 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface OrderFollowLogAttachmentMapper extends BaseMapperX<OrderFollowLogAttachmentDO> {

    default List<OrderFollowLogAttachmentDO> selectListByFollowLogId(Long followLogId) {
        return selectList(new LambdaQueryWrapperX<OrderFollowLogAttachmentDO>()
                .eq(OrderFollowLogAttachmentDO::getFollowLogId, followLogId)
                .orderByAsc(OrderFollowLogAttachmentDO::getSort));
    }

    default void deleteByFollowLogId(Long followLogId) {
        delete(new LambdaQueryWrapperX<OrderFollowLogAttachmentDO>()
                .eq(OrderFollowLogAttachmentDO::getFollowLogId, followLogId));
    }

}